package com.tom.architect.day18.simple3;

import android.os.Bundle;

import com.tom.architect.R;
import com.tom.architect.day18.simple3.bottomtab.TabBottomNavigation;
import com.tom.architect.day18.simple3.bottomtab.iterator.ListTabIterator;

import androidx.appcompat.app.AppCompatActivity;

public class TabActivity extends AppCompatActivity {
    private TabBottomNavigation mTabBottomNavigation;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main18);
        mTabBottomNavigation = findViewById(R.id.tab_bottom);

/*        List<BottomTabItem> tabItems = new ArrayList<BottomTabItem>();
        tabItems.add(new MainBottomTabItem.Builder(this)
                .resIconId(R.drawable.main_tab_item)
                .text("首页").create());
        tabItems.add(new MainBottomTabItem.Builder(this)
                .text("首页2").create());
        tabItems.add(new MainBottomTabItem.Builder(this)
                .text("首页3").create());*/
        // 迭代器模式，可以传入list，Array[],
        ListTabIterator<MainBottomTabItem> listIterator = new ListTabIterator<>();
        listIterator.addItem(new MainBottomTabItem.Builder(this)
                .resIconId(R.drawable.main_tab_item)
                .text("首页").create());
        listIterator.addItem(new MainBottomTabItem.Builder(this)
                .resIconId(R.drawable.main_tab_item)
                .text("首页2").create());
        listIterator.addItem(new MainBottomTabItem.Builder(this)
                .resIconId(R.drawable.main_tab_item)
                .text("首页3").create());

        mTabBottomNavigation.addTabItem(listIterator);
    }


}
